package com.xncoding.jwt.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;


/***
 * <p>
 *    此处用于封装webSocket配置属性信息
 * </p>
 *
 * @author feilong
 * @since 2024/5/30
 * @Version 1.0
 * @return webSocket配置连接
 */
@Configuration
public class WebSocketConfigProperties {

    /***
     * socket链接前缀
     *
     * 如果客户端采用https协议则需要使用wss作为连接前缀
     */
    @Value("${socket.connectPrefixProtocol}")
    private String socketPrefixProtocol;


    /***
     * socket服务端所在地址
     */
    @Value("${socket.connectAddress}")
    private String socketConnectAddress;

    /***
     * <p>
     *    获取webSocket配置连接
     * </p>
     *
     * @author feilong
     * @since 2024/5/30
     * @Version 1.0
     * @return webSocket配置连接
     */
    public String getSocketConnectUrl() {
        return socketPrefixProtocol + socketConnectAddress;
    }

    public String getSocketPrefixProtocol() {
        return socketPrefixProtocol;
    }

    public String getSocketConnectAddress() {
        return socketConnectAddress;
    }
}
